/* let b = 10 + null + true + [] + undefined + '珠峰' + null + [] + 10 + false; */
/*
10 + null => 10 + 0 = 10
11 + true => 10 + 1 = 11
11 + [] => "11" 空数组变为数字, 先要经历变为空字符串, 遇到字符串, 啥都别想了, 直接变为字符串拼接
"11" + undefined => 11undefined
*/
// console.log(b);

// 腾讯面试题
/* var a = 'abc' + 123 + 456;
var b = '456' - '123';
var c = 100 + true + 21.2 + null + undefined + "Tencent" + [] + null + 9 + false;
console.log(a, b, c);
// a = 'abc123456' */
// b = 333
// c = 101 + 21.2 = NaNTencentnull9false

/* var str = "abc123";
var num = parseInt(str)
if(num == NaN) {
  alert(NaN);
}else if(num == 123) {
  alert(123);
}else if(typeof num == 'number') {
  alert('number');
}else {
  alert('str');
} */

/* let a = 12;
if (a > 0 && a <= 20) {
  if(a % 2 === 0) {
    a += 2;
  }
}else {
  a -= 2;
}

a > 0 && a <= 20 ? ((a % 2 === 0) ? a += 2 : null) : a -= 2
/* a ? ((a > 0 && a <= 20) ? ((a % 2 === 0) ? a += 2 : null) : null) : a -= 2; 
console.log(a); */

/* let a = '10';
a == 10 ? a++ : a--;
console.log(a); // 11

let b = '20';
switch(b) {
  case 10:
    b++;
    break;
  default:
    b--;
}
console.log(b); // 19 */

let i = 3;
console.log(5 + (++i) + (i++) + 3 - 2 + (--i) + (i--) - 2);
console.log(i);
/* 
 * i 3 4 3
 * 5 + (++i) = 9
 * 9 + (i++) = 13
 * 13 + 3 - 2 = 14
 * 14 + (--i) => 17
 * 
*/